<!DOCTYPE html>
<html>
{include file="head.html"}
<body>
<div class="body">
<div class="header">
    <a href="{$appkucun}?m=kucun_product"  class="left-btn"><span class="iconfont icon-back"></span></a>
    <div class="title">产品添加</div>
    
  </div>
<div class="main-body ">
	  
    <style>
 	 
		.plist .item .num{width:30px; margin-right:10px; height:20px;}
		.plist .item .catid{width:60px; margin-right:10px; height:22px;}
    </style>
    <div class="plist">
    	{foreach item=c from=$kclist}
        <div class="item">
        	<div class="g-sd1">
            	<img src="{$c.imgurl|images_site}.100x100.jpg">
                  
            </div>
            <div class="g-mn1">
            	<div class="g-mn1c">
                	<div class="title">{$c.title}</div>
                    <div>{$c.kc_title}</div>
                    <div class="row-price">
                    	<span>库存：{$c.total_num}</span> 
                        <span>销量：{$c.buy_num}</span> 
                        <span>￥{$c.price}元</span>                         
                        </div>
                   
                                         
                    <div class="pro">
                     <input type="text" class="num" value="1">
                    <a href="javascript:;" productid="{$c.id}" class="btn  btn-small btn-success addProduct" url="{$appkucun}?m=kucun_product&a=addProduct&productid={$c.id}&ajax=1">添加</a></div>
                </div>
               
            </div>
             <div class="clearfix"></div>
        </div>
    	{/foreach}
    </div>

	 {$pagelist}
</div>
<script>
$(function(){
	$(document).on("click",".addProduct",function(){
		var obj=$(this);
		$.get("{$appkucun}?m=kucun_product&a=addProduct&ajax=1&productid="+$(this).attr("productid")+"&total_num="+$(this).siblings(".num").val(),function(data){
			if(data.error){
				skyToast(data.message);
			}else{
				obj.parents(".item").remove();
			}
		},"json");
		
	});
});
</script>  
</div>

</div> 
{include file='footer.html'}